package com.mingqijia.gassafety.job.response;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.util.StringUtils;

import java.util.Date;


/**
 * @author guoliang.lao
 * @version 1.0.0
 * @ClassName BrokenLogResponse.java
 * @Description 故障记录返回
 * @createTime 2022年03月08日
 */
@Data
public class BrokenLogResponse {

    @ApiModelProperty("设备ID")
    private String equipmentId = "";

    @ApiModelProperty("设备号")
    private String imei = "";

    @ApiModelProperty("设备名称")
    private String equipmentName = "";

    @ApiModelProperty("设备类型")
    private String equipmentType = "";

    @ApiModelProperty("设备类型名称")
    private String equipmentTypeName = "";

    @ApiModelProperty("设备位置")
    private String installationPosition = "";

    @ApiModelProperty("故障原因")
    private String brokenReason = "";

    @ApiModelProperty("设备型号")
    private String equipmentModel;

    @ApiModelProperty("设备厂商")
    private String equipmentManufacturer;

    @ApiModelProperty("故障时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date latestTime;

    @ApiModelProperty("户名")
    private String custName;

    @ApiModelProperty("户号")
    private String subsCode;

    @ApiModelProperty("户址")
    private String custAddress;

    @ApiModelProperty("户主手机号")
    private String custPhone;

    @ApiModelProperty("行业类型")
    private String industryType;

    @ApiModelProperty("行业类型名")
    private String industryTypeName;

    @ApiModelProperty("安装地址")
    private String installationAddress;

    @ApiModelProperty("客户id")
    private Integer consumerId;

    @ApiModelProperty("用户id")
    private String memberId;

    @ApiModelProperty("联系人姓名")
    private String contactName;

    @ApiModelProperty("联系人手机号")
    private  String contactPhone;

    @ApiModelProperty("id")
    private Long id = 0L;

    @ApiModelProperty("回路和点位")
    private String subId = "";

    @ApiModelProperty(value = "处理状态")
    private String appealStatusMsg;

    @ApiModelProperty(value = "处理人信息")
    private String userInfo;

    @ApiModelProperty(value = "所属组织")
    private String spName;

    @ApiModelProperty(value = "设备上是否有电磁阀,与紫荆设备无关")
    private String hasValve;

    @ApiModelProperty(value = "报警持续时长")
    private String warnDuration;

    @ApiModelProperty(value = "处理时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date appealTime;

    @ApiModelProperty(value = "处理详情")
    private String appealResult;

    @ApiModelProperty(value = "客户名称")
    private String name;
    @ApiModelProperty(value = "客户类型, 默认0:普通客户,1紫荆客户")
    private String custType;
    @ApiModelProperty(value = "检测类型")
    private String detectionType;
    @ApiModelProperty(value = "经纬度")
    private String lonLat;
    @ApiModelProperty(value = "通讯方式")
    private String communicationMode;
    @ApiModelProperty(value = "运营商")
    private String operators;
    @ApiModelProperty(value = "联系人（级别1）姓名")
    private String contactName1;
    @ApiModelProperty(value = "联系人（级别1）联系方式")
    private String contactPhone1;
    private String level1;
    private String level2;
    private String level3;
    private String level4;
    private String level5;
    private String level6;
    private String level7;
    private String level8;
    private String level9;
    private String level10;

    @ApiModelProperty(value = "联系人（级别2）姓名")
    private String contactName2;
    @ApiModelProperty(value = "联系人（级别2）联系方式")
    private String contactPhone2;

    @ApiModelProperty(value = "联系人（级别3）姓名")
    private String contactName3;
    @ApiModelProperty(value = "联系人（级别3）联系方式")
    private String contactPhone3;

    @ApiModelProperty(value = "联系人（级别4）姓名")
    private String contactName4;
    @ApiModelProperty(value = "联系人（级别4）联系方式")
    private String contactPhone4;

    @ApiModelProperty(value = "联系人（级别5）姓名")
    private String contactName5;
    @ApiModelProperty(value = "联系人（级别5）联系方式")
    private String contactPhone5;

    @ApiModelProperty(value = "联系人（级别6）姓名")
    private String contactName6;
    @ApiModelProperty(value = "联系人（级别6）联系方式")
    private String contactPhone6;

    @ApiModelProperty(value = "联系人（级别7）姓名")
    private String contactName7;
    @ApiModelProperty(value = "联系人（级别7）联系方式")
    private String contactPhone7;
    @ApiModelProperty(value = "联系人（级别8）姓名")
    private String contactName8;
    @ApiModelProperty(value = "联系人（级别8）联系方式")
    private String contactPhone8;
    @ApiModelProperty(value = "联系人（级别9）姓名")
    private String contactName9;
    @ApiModelProperty(value = "联系人（级别9）联系方式")
    private String contactPhone9;
    @ApiModelProperty(value = "联系人（级别10）姓名")
    private String contactName10;
    @ApiModelProperty(value = "联系人（级别10）联系方式")
    private String contactPhone10;


    public void setContact(Object c) {
        if (StringUtils.isEmpty(c)) return;
        String[] contacts=(String[])c;
        if (contacts.length <= 0) return;
        this.contactName1 = contacts[0];
        this.contactPhone1 = contacts[1];
        this.contactName2 = contacts[2];
        this.contactPhone2 = contacts[3];
        this.contactName3 = contacts[4];
        this.contactPhone3 = contacts[5];
        this.contactName4 = contacts[6];
        this.contactPhone4 = contacts[7];
        this.contactName5 = contacts[8];
        this.contactPhone5 = contacts[9];
        this.contactName6 = contacts[10];
        this.contactPhone6 = contacts[11];
        this.contactName7 = contacts[12];
        this.contactPhone7 = contacts[13];
        this.contactName8 = contacts[14];
        this.contactPhone8 = contacts[15];
        this.contactName9 = contacts[16];
        this.contactPhone9 = contacts[17];
        this.contactName10 = contacts[18];
        this.contactPhone10 = contacts[19];
        this.level1 = contacts[20];
        this.level2 = contacts[21];
        this.level3 = contacts[22];
        this.level4 = contacts[23];
        this.level5 = contacts[24];
        this.level6 = contacts[25];
        this.level7 = contacts[26];
        this.level8 = contacts[27];
        this.level9 = contacts[28];
        this.level10 = contacts[29];
    }

    @ApiModelProperty(value = "燃气公司")
    private String companyName;
}
